<?php

namespace App\Models\users;

use App\Models\BaseModel;
use lxs\tools\Tools;

class UsersBankModel extends BaseModel
{
    protected $table = 'users_bank';
    protected $primaryKey = 'id';


    /**
     * 获取银行图标
     * @param $name
     * @return void
     */
    public static function getIcon($name) : string {

        if ( Tools::checkSubstr($name, '工商') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/finance/%E5%B7%A5%E5%95%86%E9%93%B6%E8%A1%8C-01_1.png';
        } else if ( Tools::checkSubstr($name, '农业') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E4%B8%AD%E5%9B%BD%E5%86%9C%E4%B8%9A%E9%93%B6%E8%A1%8C.png';
        } else if ( Tools::checkSubstr($name, '中国银行') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E4%B8%AD%E5%9B%BD%E9%93%B6%E8%A1%8C.png';
        } else if ( Tools::checkSubstr($name, '交通') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E4%BA%A4%E9%80%9A%E9%93%B6%E8%A1%8C.png';
        } else if ( Tools::checkSubstr($name, '建设') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E5%BB%BA%E8%AE%BE%E9%93%B6%E8%A1%8C.png';
        } else if ( Tools::checkSubstr($name, '招商') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C_1.png';
        } else if ( Tools::checkSubstr($name, '邮政') ) {
            return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/bank/%E9%82%AE%E6%94%BF%E5%82%A8%E8%93%84%E9%93%B6%E8%A1%8C.png';
        }
        return 'https://ouan-retail.oss-cn-shenzhen.aliyuncs.com/web/finance/%E9%92%B1%E5%8C%85.png';
    }

}
